package com.dan.inter.web;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.dan.inter.service.ALiYunApiService;
import com.dan.inter.vo.ALiyunFaceAgeVO;

/**
 * 
 * @ClassName:  AliyunController   
 * @Description:阿里云-人脸识别
 * @author: Android_Robot  
 * @date:   2017年7月20日 上午9:01:44   
 *
 */
@RestController
@RequestMapping("/aliyun")
public class AliyunController {

	@Autowired
	private ALiYunApiService aLiYunApiService;
	
	/**
	 * @Title: faceRecognition   
	 * @Description: 脸部特征识别-此方法仅适用于图片可以从远程下载下来的识别！暂不识别本地上传过来的路径
	 * @param: @param paramMap
	 * @param: @return      
	 * @return: String      
	 * @throws
	 */
	@RequestMapping(value = "/face", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
	public String faceRecognition(Map<String,String> paramMap){
		String faceRecognition = aLiYunApiService.faceRecognition(paramMap.get("imageDate"));
		return faceRecognition;
	}
	
	/**
	 * @Title: faceAge   
	 * @Description: 人脸年龄验证   
	 * @param: @param paramMap
	 * @param: @return      
	 * @return: String      
	 * @throws
	 */
	@RequestMapping(value = "/faceAge", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
	public String faceAge(ALiyunFaceAgeVO aLiyunFaceAgeVO){
		String respronse = aLiYunApiService.faceAgeRecognition(aLiyunFaceAgeVO);
		String result = aLiYunApiService.faceAgeConvert(respronse);
		return result;
	}
}
